﻿
namespace TanHungViet.Web.Models
{
    using System.Web;
    using System.Web.Mvc;
    using System.ComponentModel.DataAnnotations;
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using TanHungViet.Helper;
    using log4net;


    public partial class Content
    {
        public string ContentDetail { get; set; }
        public string ContentDetail2 { get; set; }
        public string ContentTitle { get; set; }
        public string ContentTitle2 { get; set; }
        public string BriefDescrip { get; set; }
        public string BriefDescrip2 { get; set; }
        public string Investor { get; set; }
        public string Address { get; set; }
        public string Designer { get; set; }
        public string ActionDetail { get; set; }
        public bool InHomePage { get; set; }

        public Content() { }
        public Content(string imageUrl, string title, string title2, string descrip, string descrip2,
                string detail, string detail2, string investor, string address, string designer)
        {
            ContentID = 0;
            ContentImage = imageUrl ?? string.Empty;
            ContentTitle = title ?? string.Empty;
            ContentTitle2 = title2 ?? string.Empty;
            BriefDescrip = descrip ?? string.Empty;
            BriefDescrip2 = descrip2 ?? string.Empty;
            ContentDetail = detail ?? string.Empty;
            ContentDetail2 = detail2 ?? string.Empty;

            Investor = investor;
            Address = address;
            Designer = designer;
            ActionDetail = string.Empty;
            InHomePage = false;
        }
    }

    [Bind(Exclude = "ContentID")]
    public class CotentValidation
    {
        [Required(ErrorMessage = "Tiêu đề không được bỏ trống")]
        [StringLength(1000, ErrorMessage = "Tiêu đề không được vượt quá 100 ký tự!")]
        public string ContentTitle { get; set; }

        [StringLength(2000, ErrorMessage = "Mô tả ngắn gọn, không vượt quá 500 ký tự!")]
        public string BriefDescription { get; set; }

        [Required(ErrorMessage = "Nội dung không thể bỏ trống")]
        public string ContentDetail { get; set; }
    }


    public class ListContent
    {
        public ListContent() { Items = new List<Content>(); }
        public List<Content> Items { get; set; }
    }


    public class MenuItem
    {
        public string Link { get; set; }
        public string Title { get; set; }
        public string Code { get; set; }
        public int ContentID { get; set; }

        public List<MenuItem> SubMenu { get; set; }

        public MenuItem()
        {
            Link = string.Empty;
            Title = string.Empty;
            Code = string.Empty;
            ContentID = 0;
            SubMenu = null;
        }
    } 
}
